<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<title>Fly Template v2.0，基于 layui 的轻量级社区模版</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="fly,layui,前端社区">
<meta name="description"
	content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
<link rel="stylesheet"
	href="${ pageContext.request.contextPath }/res/layui/css/layui.css">
<link rel="stylesheet"
	href="${ pageContext.request.contextPath }/res/css/global.css">
<style>
  	.tab{display:none}
</style>
<script type="text/javascript" src="${ pageContext.request.contextPath }/res/js/template-web.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
	$(function(){
		$('#del_item').click(function(){
			var bool = confirm('确定删除该文章吗');
			if(bool){
				$.ajax({
					url:'${pageContext.request.contextPath}/article/delbyid',
					data:{
						"artid":'${artmap.artid}'
					},
					dataType:'json',
					type:'post',
					async:true,
					success:function(data){
						if(data == 1){
  							window.location.href = '${ pageContext.request.contextPath }/jsp/index.jsp';
  						}
					},
					error:function(){
						alert('删除失败');
					}
				})
			}
		})
		$('.del_an').click(function(){
			var id = $(this).closest('li').find('input:last-child').val();
			var bool = confirm('确定删除该评论吗');
			if(bool){
				$.ajax({
					url:'${pageContext.request.contextPath}/article/delanbyid',
					data:{					
						"id":id
					},
					dataType:'json',
					type:'post',
					async:true,
					success:function(data){
						window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
					},
					error:function(){
						alert('删除失败');
					}
				})
			}
		})
		//点赞
		$('.zanok').click(function(){
		
			var id = $(this).closest('li').find('input:last-child').val();
				$.ajax({
					url:'${pageContext.request.contextPath}/article/zanOkById',
					data:{					
						"id":id
					},
					dataType:'json',
					type:'post',
					async:true,
					success:function(data){
						window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
					},
					error:function(){
						alert('点赞失败');
					}
				})
		})
		
		$('#top_item').click(function(){
			$.ajax({
				url:'${pageContext.request.contextPath}/article/upstickbyid',
				data:{
					"artid":'${artmap.artid}'
				},
				dataType:'json',
				type:'post',
				async:true,
				success:function(data){
					window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
					},
				error:function(){
					alert('删除失败');
				}
			})			
		})
		$('#notop_item').click(function(){
			$.ajax({
				url:'${pageContext.request.contextPath}/article/upnostickbyid',
				data:{
					"artid":'${artmap.artid}'
				},
				dataType:'json',
				type:'post',
				async:true,
				success:function(data){
					window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
					},
				error:function(){
					alert('删除失败');
				}
			})			
		})
		$('#cream_item').click(function(){
			$.ajax({
				url:'${pageContext.request.contextPath}/article/upcreambyid',
				data:{
					"artid":'${artmap.artid}'
				},
				dataType:'json',
				type:'post',
				async:true,
				success:function(data){
					window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
					},
				error:function(){
					alert('删除失败');
				}
			})			
		})
		$('#nocream_item').click(function(){
			$.ajax({
				url:'${pageContext.request.contextPath}/article/upnocreambyid',
				data:{
					"artid":'${artmap.artid}'
				},
				dataType:'json',
				type:'post',
				async:true,
				success:function(data){
					window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
					},
				error:function(){
					alert('删除失败');
				}
			})			
		})
		$('.on_caina').click(function(){
			var commid = $(this).closest('li').find('input:last-child').val();
			$.ajax({
				url:'${pageContext.request.contextPath}/article/caina',
				data:{
					"artid":'${artmap.artid}',
				},
				dataType:'json',
				type:'post',
				async:true,
				success:function(data){
					if(data == 1){
						console.log(commid);
					$.ajax({
						url:'${pageContext.request.contextPath}/article/cainacc',
						data:{
							"authorid":commid,
							"paykiss":'${artmap.paykiss}'
						},
						dataType:'json',
						type:'post',
						async:true,
						success:function(data){
							window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
						}						
					})
					}
					},
				error:function(){
					alert('删除失败');
				}
			})			
		})
		//收藏
		$('#collects').click(function(){
			$.ajax({
				url:'${pageContext.request.contextPath}/article/addcollects',
				data:{
					"articleid":'${artmap.artid}',
				},
				dataType:'json',
				type:'post',
				async:true,
				success:function(data){
					window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
					},
				error:function(){
					alert('收藏失败');
				}
			})			
		})
		//不收藏
		$('#no_collects').click(function(){
			$.ajax({
				url:'${pageContext.request.contextPath}/article/nocollects',
				data:{
					"articleid":'${artmap.artid}',
				},
				dataType:'json',
				type:'post',
				async:true,
				success:function(data){
					window.location.href = '${ pageContext.request.contextPath }/article/loaddetail?artid=${artmap.artid}';
					},
				error:function(){
					alert('取消收藏失败');
				}
			})			
		})
		
		// 评论的是评论--1
  		$(document).on('click','.small_remark',function(){
  			$(this).closest('div').next().toggleClass('tab');
  			var name = $(this).closest('li').find('cite').find('i').html();
  			$(this).closest('div').next().find('textarea').html('@'+name+':');
  		})
  		// 评论的是评论--2
  		$(document).on('click','.re_remark',function(){
  			var json = {
						'headurl' : '${login_user.headurl}', // 头像
						'nickname' : '${login_user.nickname}',// 昵称
						'remarktime' : '刚刚',// 时间
						'remarkcontent' : $(this).prev().val(),// 内容
						'goodnum' : 0, // 点赞
						'userid' : '${login_user.id}',// 用户id
						'authority' : '${login_user.authority}', // 权限
						'experience' : '${login_user.experience}'// 经验
				};
				var text = template('remark_model',json);
				$('#jieda').append(text);
				// 发ajax请求
				$.ajax({
					url : '${ pageContext.request.contextPath }/article/addremark',
					type : 'post',
					dataType : 'json',
					data : {
						'authorid' : '${login_user.id}',
						'commcontent' : $(this).prev().val(),
						'artidorcommid' : '${artmap.artid}'
					},
					success : function(data){
						alert('评论成功');
						// 将返回的主键值挂载在隐藏域中
						$('#jieda').find('li:last-child').find('input').val(data);
					},
					async : true,
					error : function(){
						alert('评论失败');
					}
				})
				$(this).closest('div').toggleClass('tab');
  		})
  		// 点击按钮评论
		$('.remark').click(function(){
			if('${login_user}' == ''){
				var bool = confirm('您还没有登录，不能评论，是否登录？');
				if(bool){
					window.location.href = '${ pageContext.request.contextPath }/jsp/user/login.jsp';
				}
			}else{
				var json = {
						'headurl':'${login_user.headurl}', //头像
						'nickname' : '${login_user.nickname}',// 昵称
  						'remarktime' : '刚刚',// 时间
  						'remarkcontent' : $('#L_content').val(),// 内容
  						'goodnum' : 0, // 点赞
  						'userid' : '${login_user.id}',// 用户id
  						'authority' : '${login_user.authority}', // 权限
  						'experience' : '${login_user.experience}'// 经验
				};
				var text = template('remark_model',json);
				$('#jieda').append(text);
				$.ajax({
  					url : '${ pageContext.request.contextPath }/article/addremark',
  					type : 'post',
  					dataType : 'json',
  					data : {
  						'authorid' : '${login_user.id}',
  						'commcontent' : $('#L_content').val(),
  						'artidorcommid' : '${artmap.artid}'
  					},
  					success : function(data){
  						alert('评论成功');
  						// 将返回的主键值挂载在隐藏域中
  						$('#jieda').find('li:last-child').find('input').val(data);
  					},
  					async : true,
  					error : function(){
  						alert('评论失败');
  					}
  				})
  				$('#L_content').val('');
			}
			
		})
		
		
	})
</script>
</head>
<body>

	<div class="header">
		<div class="main">
			<a class="logo" href="/" title="Fly">Fly社区</a>
			<div class="nav">
				<a class="nav-this" href="index.html"> <i
					class="iconfont icon-wenda"></i>问答
				</a> <a href="http://www.layui.com/" target="_blank"> <i
					class="iconfont icon-ui"></i>框架
				</a>
			</div>
<!-- =======================================登录与未登录状态================================================ -->
			<div class="nav-user">
				<!-- 未登入状态 -->
				<c:if test="${login_user == null }">
					<a class="unlogin" href="user/login.html"><i
						class="iconfont icon-touxiang"></i></a>
					<span><a
						href="${ pageContext.request.contextPath }/jsp/user/login.jsp">登入</a><a
						href="${ pageContext.request.contextPath }/jsp/user/reg.jsp">注册</a></span>
					<p class="out-login">
						<a href=""
							onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})"
							class="iconfont icon-qq" title="QQ登入"></a> <a href=""
							onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})"
							class="iconfont icon-weibo" title="微博登入"></a>
					</p>
				</c:if>
				<!-- 登入后的状态 -->
				<c:if test="${login_user != null }">

					<a class="avatar" href="${ pageContext.request.contextPath }/jsp/index.jsp"> <img
						src="${ pageContext.request.contextPath }/res/images/avatar/${login_user.headurl}">
						<cite>${login_user.nickname}</cite> <i>VIP2</i>
					</a>
					<div class="nav">
						<a href="${ pageContext.request.contextPath }/jsp/user/index.jsp"><i
							class="iconfont icon-shezhi"></i>设置</a> <a
							href="${ pageContext.request.contextPath }/user/logout"><i
							class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>退了</a>
					</div>
				</c:if>

			</div>
		</div>
	</div>

<!-- =======================================文章细节================================================ -->
	<div class="main layui-clear">
		<div class="wrap">
			<div class="content detail">
				<div class="fly-panel detail-box">
					<h1>${ artmap.title }</h1>
        <div class="fly-tip fly-detail-hint" data-id="{{rows.id}}">
        <c:if test="${ artmap.stick == 1 }">
         	<span class="fly-tip-stick">置顶帖</span>
        </c:if>
        <c:if test="${ artmap.cream == 1 }">
          <span class="fly-tip-jing">精帖</span>
        </c:if>  
        <c:if test="${ artmap.isdone == 0 }">
          <span>未结贴</span>
        </c:if>   
        <c:if test="${ artmap.isdone == 1 }">
          <span class="fly-tip-jie">已采纳</span>
        </c:if>
         <c:if test="${ login_user.authority == 1 || login_user.id == artmap.authorid }">
          	<span id="del_item" class="jie-admin" type="del" style="margin-left: 20px;">删除</span>
         </c:if>
        <c:if test="${ login_user.authority == 1}">
          <c:if test="${ artmap.stick == 0 }">
          	<span id="top_item" class="jie-admin" type="set" field="stick" rank="1">置顶</span> 
          </c:if>
          <c:if test="${ artmap.stick == 1 }">
          	<span id="notop_item" class="jie-admin" type="set" field="stick" rank="0" style="background-color:#ccc;">取消置顶</span>
          </c:if>
          <c:if test="${ artmap.cream == 0 }">
          	<span id="cream_item" class="jie-admin" type="set" field="status" rank="1">加精</span>
          </c:if>
          <c:if test="${ artmap.cream == 1 }">
          	<span id="nocream_item" class="jie-admin" type="set" field="status" rank="0" style="background-color:#ccc;">取消加精</span>
          </c:if>
        </c:if>  
          <div class="fly-list-hint"> 
            <i class="iconfont" title="回答">&#xe60c;</i> ${ artmap.commentnum }
            <i class="iconfont" title="人气">&#xe60b;</i> ${ artmap.visitnum }
          </div>
        </div>
        <div class="detail-about">
          <a class="jie-user" href="">
            <img src="${ pageContext.request.contextPath }/res/images/avatar/${artmap.headurl}" alt="">
            <cite>
              	${ artmap.nickname }
              <em>${ artmap.releasetime }</em>
            </cite>
          </a>
          <div class="detail-hits" data-id="{{rows.id}}">
            <span style="color:#FF7200">悬赏：${ artmap.paykiss }飞吻</span>
            <c:if test="${ login_user.id == artmap.authorid && artmap.isdone == 0}">            
            	<span class="layui-btn layui-btn-mini jie-admin" type="edit"><a href="${ pageContext.request.contextPath }/go/update?id=${artmap.artid}">编辑此贴</a></span>
            </c:if>
           
            <c:if test="${ login_user.id != artmap.authorid && login_user.id != null && colllist == 0 }">
            	<span id="collects" class="layui-btn layui-btn-mini jie-admin " type="collect" data-type="add">收藏</span>
            </c:if>
             <c:if test="${ login_user.id != artmap.authorid && login_user.id != null && colllist == 1}">
            <span id="no_collects" class="layui-btn layui-btn-mini jie-admin  layui-btn-danger" type="collect" data-type="add">取消收藏</span>
          	  </c:if>
          </div>
        </div>
        
        <div class="detail-body photos" style="margin-bottom: 20px;">
 			${ artmap.html_content }
        </div>
      </div>
<!-- =======================================评论区================================================ -->
		<div class="fly-panel detail-box" style="padding-top: 0;">
			<a name="comment"></a>
				<ul class="jieda photos" id="jieda">
					<c:if test="${ commlist != null }">
        				<c:forEach items="${ commlist }" var="comm">
							<li data-id="12" class="jieda-daan">
								<a name="item-121212121212"></a>
								<div class="detail-about detail-about-reply">
									<a class="jie-user" href="">
									 <img src="${ pageContext.request.contextPath }/res/images/avatar/${comm.headurl}" alt="">
									 <cite>
								 		<i>${comm.nickname}</i> 
								 		 <c:if test="${comm.authorid == artmap.authorid}">
								 			<em>(楼主)</em>
								 		 </c:if>
                 					 	<c:if test="${comm.authority == 1}">
                 							 <em style="color:#5FB878">(管理员)</em>
                 						 </c:if>
                  						 <c:if test="${comm.experience > 100}">
                 							 <em style="color:#FF9E3F">（活雷锋）</em>
                 				    	 </c:if>
									 </cite>
									</a>
									<div class="detail-hits">
										<span>${comm.commtime}</span>
									</div>
									<c:if test="${comm.isaccept == 1 }">
              							<i class="iconfont icon-caina" title="最佳答案"></i>
             				   	    </c:if>
								</div>
								<div class="detail-body jieda-body">
									<p>${comm.commcontent}</p>
								</div>
								<div class="jieda-reply">
									<span class="jieda-zan zanok" type="zan">
									<i class="iconfont icon-zan"></i>
									<em>${comm.praisepoints}</em>
									</span> 
									<span type="reply">
									<i class="iconfont icon-svgmoban53"></i>回复
									</span>
									<div class="jieda-admin">
                						<c:if test="${ login_user.id == comm.authorid}">
                							<span type="edit">编辑</span>
               							</c:if>
                						<c:if test="${ login_user.id == comm.authorid || login_user.authority == 1 }">
                							<span class="del_an" type="del">删除</span>
               							</c:if>
               							<c:if test="${ login_user.id == artmap.authorid && login_user.id != comm.authorid && artmap.isdone == 0}">
                							<span class="jieda-accept on_caina" type="accept">采纳</span>
               							</c:if>
             					    </div>
								</div>
								<div class="tab" style="padding-top:10px;">
									<textarea placeholder="评论" row="10" col="90" class="layui-textarea fly-editor"></textarea>
									<button style="background:red;transform:scale(0.8);" type="button" class="layui-btn re_remark">提交回答</button>
								</div>
								<input class="hidden_commid" type="hidden" value="${ comm.commid }">
							</li>
						</c:forEach>
         			 </c:if>
<!-- ======================================================================================= -->

						<%-- <li data-id="13"><a name="item-121212121212"></a>
							<div class="detail-about detail-about-reply">
								<a class="jie-user" href=""> <img
									src="${ pageContext.request.contextPath }/res/images/avatar/default.png"
									alt=""> <cite> <i>香菇</i> <em
										style="color: #FF9E3F">活雷锋</em>
								</cite>
								</a>
								<div class="detail-hits">
									<span>刚刚</span>
								</div>
							</div>
							<div class="detail-body jieda-body">
								<p>蓝瘦</p>
							</div>
							<div class="jieda-reply">
								<span class="jieda-zan" type="zan"><i
									class="iconfont icon-zan"></i><em>0</em></span> <span type="reply"><i
									class="iconfont icon-svgmoban53"></i>回复</span>
								<div class="jieda-admin">
									<span type="edit">编辑</span> <span type="del">删除</span> <span
										class="jieda-accept" type="accept">采纳</span>
								</div>
							</div></li> --%>

						<!-- <li class="fly-none">没有任何回答</li> -->
					</ul>

					<div class="layui-form layui-form-pane">
						<form action="/jie/reply/" method="post">
							<div class="layui-form-item layui-form-text">
								<div class="layui-input-block">
									<textarea id="L_content" name="content" required
										lay-verify="required" placeholder="我要回答"
										class="layui-textarea fly-editor" style="height: 150px;"></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<input type="hidden" name="jid" value="{{rows.id}}">
								<button type="button" class="layui-btn remark" >提交回答</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
<!-- =======================================最近热帖================================================ -->
		<div class="edge">
			<dl class="fly-panel fly-list-one">
				<dt class="fly-panel-title">最近热帖</dt>
				<c:if test="${ hotlist !=null }">
					<c:forEach items="${ hotlist }" var="hot">
						<dd>
							<a href="${ pageContext.request.contextPath }/article/loaddetail?artid=${hot.id}">${ hot.title }</a> <span><i
								class="iconfont">&#xe60b;</i>${ hot.visitnum }</span>
						</dd>
					</c:forEach>
				</c:if>
				<!-- <dd>
					<a href="">Java实现LayIM后端的核心代码</a> <span><i class="iconfont">&#xe60b;</i>
						767</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局（基本结构）</a> <span><i
						class="iconfont">&#xe60b;</i> 6087</span>
				</dd>
				<dd>
					<a href="">Java实现LayIM后端的核心代码</a> <span><i class="iconfont">&#xe60b;</i>
						767</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局（基本结构）</a> <span><i
						class="iconfont">&#xe60b;</i> 6087</span>
				</dd>
				<dd>
					<a href="">Java实现LayIM后端的核心代码</a> <span><i class="iconfont">&#xe60b;</i>
						767</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局（基本结构）</a> <span><i
						class="iconfont">&#xe60b;</i> 6087</span>
				</dd>
				<dd>
					<a href="">Java实现LayIM后端的核心代码</a> <span><i class="iconfont">&#xe60b;</i>
						767</span>
				</dd> -->
			</dl>
<!-- =======================================近期热议================================================ -->
			<dl class="fly-panel fly-list-one">
				<dt class="fly-panel-title">近期热议</dt>
					<c:if test="${ visitlist !=null }">
						<c:forEach items="${ visitlist }" var="visit">
							<dd>
			                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      					<a href="${ pageContext.request.contextPath }/article/loaddetail?artid=${visit.id}">${ visit.title }</a> <span><i
									class="iconfont">&#xe60c;</i>${visit.commentnum}</span>
							</dd>
						</c:forEach>
					</c:if>
				<!-- <dd>
					<a href="">使用 layui 秒搭后台大布局之基本结构</a> <span><i
						class="iconfont">&#xe60c;</i> 96</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局之基本结构</a> <span><i
						class="iconfont">&#xe60c;</i> 96</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局之基本结构</a> <span><i
						class="iconfont">&#xe60c;</i> 96</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局之基本结构</a> <span><i
						class="iconfont">&#xe60c;</i> 96</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局之基本结构</a> <span><i
						class="iconfont">&#xe60c;</i> 96</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局之基本结构</a> <span><i
						class="iconfont">&#xe60c;</i> 96</span>
				</dd>
				<dd>
					<a href="">使用 layui 秒搭后台大布局之基本结构</a> <span><i
						class="iconfont">&#xe60c;</i> 96</span>
				</dd> -->
			</dl>
		</div>
	</div>


	<div class="footer">
		<p>
			<a href="http://fly.layui.com/">Fly社区</a> 2017 &copy; <a
				href="http://www.layui.com/">layui.com</a>
		</p>
		<p>
			<a href="http://fly.layui.com/auth/get" target="_blank">产品授权</a> <a
				href="http://fly.layui.com/jie/8157.html" target="_blank">获取Fly社区模版</a>
			<a href="http://fly.layui.com/jie/2461.html" target="_blank">微信公众号</a>
		</p>
	</div>
	<script src="${ pageContext.request.contextPath }/res/layui/layui.js"></script>
	<script>
		/* layui.cache.page = 'jie';
		 layui.cache.user = {
		 username: '游客'
		 ,uid: -1
		 ,avatar: '${ pageContext.request.contextPath }/res/images/avatar/00.jpg'
		 ,experience: 83
		 ,sex: '男'
		 };
		 layui.config({
		 version: "2.0.0"
		 ,base: '${ pageContext.request.contextPath }/res/mods/'
		 }).extend({
		 fly: 'index'
		 }).use('fly', function(){
		 var fly = layui.fly;
		 //如果你是采用模版自带的编辑器，你需要开启以下语句来解析。

		 $('.detail-body').each(function(){
		 var othis = $(this), html = othis.html();
		 othis.html(fly.content(html));
		 });

		 }); */
	</script>
	<!-- =======================================前端渲染模板================================================ -->
	<script type="text/html" id="remark_model">
		<li data-id="12" class="jieda-daan">
			<a name="item-121212121212"></a>
			<div class="detail-about detail-about-reply">
				<a class="jie-user" href="">
					<img src="${ pageContext.request.contextPath }/res/images/avatar/{{headurl}}" alt="">
 					<cite> 	
						<i>{{nickname}}</i>
						{{ if userid == ${artmap.authorid} }}
							<em>(楼主)</em>
						{{/if}}
                 	    {{ if authority == 1 }}
				 			<em style="color:#5FB878">(管理员)</em>
						{{/if}}
					    {{ if experiene > 100 }}
                 			<em style="color:#FF9E3F">（活雷锋）</em>
						{{/if}}
					</cite>
				</a>
				<div class="detail-hits">
					<span>{{remarktime}}</span>
				</div>
				<i style="display:none" class="iconfont icon-caina" title="最佳答案"></i>
			</div>
			<div class="detail-body jieda-body">
				<p>{{remarkcontent}}</p>
			</div>
			<div class="jieda-reply">
				<span class="jieda-zan zanok" type="zan">
					<i class="iconfont icon-zan"></i>
					<em>{{goodnum}}</em>
				</span> 
				<span class="small_remark" type="reply">
					<i class="iconfont icon-svgmoban53"></i>回复
				</span>
				<div class="jieda-admin">
               		<span type="edit">编辑</span>
               		<span type="del">删除</span>
                  {{ if userid == ${artmap.authorid} }}
               		<span class="jieda-accept" type="accept">采纳</span>
           	      {{ /if }}	
				</div>
			</div>
			<div class="tab" style="padding-top:10px;">
				<textarea placeholder="评论" row="10" col="90" class="layui-textarea fly-editor"></textarea>
				<button style="background:red;transform:scale(0.8);" type="button" class="layui-btn re_remark">提交回答</button>
			</div>
			<input type="hidden" value="">
		</li>
	</script>
</body>
</html>